package com.ruoyi.web.controller.zsix;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.zsix.domain.process.ProcessManage;
import com.ruoyi.zsix.service.IProcessManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/processManage")
public class ProcessManageController extends BaseController {
    @Autowired
    private IProcessManageService processManageService;
    /**
     * 获取流程实例参数
     * @param processManage
     * @return
     */
    @Log(title = "获取流程实例参数" , businessType = BusinessType.EXPORT)
    @PostMapping(value = "/getManageParams")
    public AjaxResult getManageParams(@RequestBody ProcessManage processManage) {
        return success(processManageService.getManageParams(processManage));
    }
    /**
     * 获取我发起的流程列表
     * @param params
     * @return
     */
    @Log(title = "获取我发起的流程列表" , businessType = BusinessType.EXPORT)
    @PostMapping(value = "/getMyStartListPage")
    public AjaxResult getMyStartListPage(@RequestBody JSONObject params) {
        return success(processManageService.getMyStartListPage(params));
    }

    /**
     * 获取我审核的流程列表
     * @param params
     * @return
     */
    @Log(title = "获取我审核的流程实例列表" , businessType = BusinessType.EXPORT)
    @PostMapping(value = "/getMyProcessPage")
    public AjaxResult getMyProcessPage(@RequestBody JSONObject params) {
        return success(processManageService.getMyProcessPage(params));
    }
}
